<!--
    Copyright 2008 Jan Molnar <jan.molnar@abds.de>

    This file is part of JCQ.

    JCQ is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    JCQ is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with JCQ. If not, see <http://www.gnu.org/licenses/>.
-->

<Window x:Class="SearchWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Contact Search" Height="300" Width="300"
    Name="SearchWindow">

    <Window.Resources>

        <ContextMenu x:Key="submenu" Opened="OnSubMenuOpened" />

        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="ContextMenu" Value="{StaticResource submenu}" />
        </Style>

    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <DockPanel>
            <TextBlock Margin="8,8,8,0" Text="UIN:" />
    <Button Margin="0,8,8,0" Content="Search" DockPanel.Dock="Right" Width="80" Click="OnSearchClick" />
    <TextBox Margin="0,8,8,0" Name="SearchText" />
    
    </DockPanel>
        <ListView Grid.Row="1" Margin="8" ItemsSource="{Binding ViewModel.SearchResult, ElementName=SearchWindow}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="UIN" DisplayMemberBinding="{Binding Name}" />
                    <GridViewColumn Header="Firstname" DisplayMemberBinding="{Binding FirstName}" />
                    <GridViewColumn Header="Lastname" DisplayMemberBinding="{Binding LastName}" />
                    <GridViewColumn Header="Email" DisplayMemberBinding="{Binding EmailAddress}" />
                    <GridViewColumn Header="Requires Auth" DisplayMemberBinding="{Binding AuthorizationRequired}" />
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</Window>
